#ifndef CUTILS_CUTILS_H_
#define CUTILS_CUTILS_H_

#include <stdarg.h>

// Panic will stop current program. By default, Panic(message) will do nothing
// and call exit(1).
void Panic(char const *message);

// A function to run before panic.
typedef void (*PanicHook)(char const *message);

// Add a hook function to run before Panic(message).
void AddPanicHook(PanicHook hook);

void VLogging(char const *fmt, va_list ap);
void Logging(char const *fmt, ...);

// Initialize logging with application name. This will add a PanicHook to print
// the panic message with Logging("PANIC %s", message).
void LoggingInit(char const *application);

#endif
